/*
 * Copyright (C) 2009 Rob Cash
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * BaseMessageStore.java
 * 
 * Created on Jan 17, 2009 at 12:18:32 PM
 */

package org.robcash.apps.messagepopup.vo.impl;

import org.robcash.apps.messagepopup.vo.MessageStoreLocation;

/**
 * Base class for message stores
 * @author Rob
 */
public abstract class BaseMessageStore {

    /**
     * Location in which messages are stored
     */
    private MessageStoreLocation location;

    /**
     * Create a new base message store
     */
    protected BaseMessageStore() {}

    /**
     * Create a new base message store
     * @param location
     */
    protected BaseMessageStore(MessageStoreLocation location) {
        this.location = location;
    }

    /**
     * Return the location of the message store
     * @return Message store location
     */
    public MessageStoreLocation getLocation() {
        return location;
    }

    /**
     * Set the location of the message store
     * @param location Location of the message store
     */
    public void setLocation(MessageStoreLocation location) {
        this.location = location;
    }

    /**
     * Indicates if the message store is read-only
     * @return <tt>true</tt> if messages cannot be added or modified
     */
    public boolean isReadOnly() {
        return true;
    }

}
